#!/usr/bin/python
import ftplib
import sys
import shutil

updn = sys.argv[1]
filename = sys.argv[2]

#s = ftplib.FTP('129.174.113.235','anonymous','') # Connect
s = ftplib.FTP('129.174.114.206','anonymous','') # Connect

print "PYTHON SCRIPT TO RUN WITH FILE: "+filename;

if updn=="put":
    f = open(filename,'rb')                # file to send
    s.storbinary("STOR "+"upload/"+filename, f)         # Send the file
    f.close()                                # Close file and FTP

if updn=="get":
    s.retrbinary("RETR "+"upload/"+filename,open(filename,'wb').write)

if updn=="del":
    s.delete("upload/"+filename)

print "PYTHON SCRIPT RAN WITH FILE: "+filename;


s.quit()
